package org.team4.web.ajax;

import java.util.List;

import org.jxc.domain.Supplier;
import org.jxc.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.Action;

@Controller
@Scope("prototype")
public class SupplierAjaxAction {

	@Autowired
	private SupplierService supplierService;

	private List<Supplier> supplierList;
	
    private String ids;

	/**
	 * 根据条件获取人员
	 * 
	 * @return
	 * @throws Exception
	 */
	public String listSupplierByCondition() throws Exception {
		supplierList = supplierService.findAll();
		return Action.SUCCESS;
	}

	public List<Supplier> getSupplierList() {
		return supplierList;
	}
    
    public String findSupplierByIds() throws Exception {
    	supplierList = supplierService.findSupplierByIds(ids);
    	return Action.SUCCESS;
    }

	public void setSupplierList(List<Supplier> supplierList) {
		this.supplierList = supplierList;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}
}